﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ledict.ConditionExtract.DAL;
using System.Data;
using Ledict.ConditionExtract.Model;
using System.Windows.Forms;

namespace Ledict.ConditionExtract.BLL
{
    public class CaseCauseBLL
    {
        CaseCauseDAL dal = new CaseCauseDAL();

        /// <summary>
        /// 是否存在该节点
        /// </summary>
        public string Exists(string CC_Name, string CC_ParentID)//子级名+父级名
        {
            return dal.Exists(CC_Name, CC_ParentID);
        }



        /// <summary>
        /// 获得数据列表(所有下级)
        /// </summary>
        public DataTable GetAllChild(string CC_ID)
        {
            return dal.GetAllChild(CC_ID);
        }

        /// <summary>
        /// 获得数据列表(所有下级)
        /// </summary>
        public DataTable GetAllChildNew(string CC_ID)
        {
            return dal.GetAllChildNew(CC_ID);
        }

        /// <summary>
        /// 获得数据列表(所有下级)
        /// </summary>
        public DataTable GetAllChild1(string CC_ID)
        {
            return dal.GetAllChild1(CC_ID);
        }

        /// <summary>
        /// 获得信息单元编号（判决书）
        /// </summary>
        /// <param name="ccId">情形情节ID</param>
        /// <param name="purposeId">用途ID，默认为空</param>
        public string GetRegCodeByJudgeBook(string ccId, string purposeId = null)
        {
            return dal.GetRegCodeByJudgeBook(ccId);

        }

        /// <summary>
        /// 获得信息单元编号（判决书）
        /// </summary>
        /// <param name="ccId">情形情节ID</param>
        /// <param name="purposeId">用途ID，默认为空</param>
        public DataTable GetRegCodeByJudgeBook1(string ccId)
        {
            return dal.GetRegCodeByJudgeBook1(ccId);
        }

        /// <summary>
        /// 根据ID获取他的父级ID
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public string GetParentIDByID(string ccID)
        {
            return dal.GetParentIDByID(ccID);
        }

        public double ComputeSerialNumb(string CC_ID, string CC_IDNext)
        {
            return dal.ComputeSerialNumb(CC_ID, CC_IDNext);

        }

        /// <summary>
        /// 获取节点下面子节点的排序序号
        /// </summary>
        /// <param name="cc_ID"></param>
        /// <param name="NeedLast">true 最大序号 false 最大序号+1</param>
        /// <returns></returns>
        public double GetNodeChildSerialNumber(string cc_ID, bool NeedLast = false)
        {
            return dal.GetNodeChildSerialNumber(cc_ID, NeedLast);
        }

        public bool UpCaseCause_IsAgainProcessData(string CC_ID)
        {
            return dal.UpCaseCause_IsAgainProcessData(CC_ID);
        }

        /// <summary>
        /// 添加情形情节
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public bool AddSYS_CaseCause(Ledict.ConditionExtract.Model.SYS_CaseCause Model, string username)
        {
            return dal.AddSYS_CaseCause(Model, username);
        }
        /// <summary>
        /// 修改情形情节
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public bool UpdateSYS_CaseCause(Ledict.ConditionExtract.Model.SYS_CaseCause Model, string username)
        {
            return dal.UpdateSYS_CaseCause(Model, username);
        }

        /// <summary>
        /// 更新当前ID及以下节点的AllParentId
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public bool CaseCauseUpdateAllPid(string CC_ID)
        {
            return dal.CaseCauseUpdateAllPid(CC_ID);
        }


        /// <summary>
        /// 通过XMLPath得到节点信息
        /// </summary>
        /// <param name="XmlPath"></param>
        /// <returns></returns>
        public DataTable GetSYS_CaseCauseByXmlPath(string XmlPath)
        {
            return dal.GetSYS_CaseCauseByXmlPath(XmlPath);
        }
        /// <summary>
        /// 通过CC_ID得到节点信息
        /// </summary>
        /// <param name="ccId"></param>
        /// <returns></returns>
        public DataTable GetSYS_CaseCauseByCCID(string ccId)
        {
            return dal.GetSYS_CaseCauseByCCID(ccId);
        }

        public SYS_CaseCause GetCaseCauseByCCID(string ccId)
        {

            return dal.GetCaseCauseByCcid(ccId);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public string GetCauseConfigXML(string ccId)
        {
            return dal.GetCauseConfigXML(ccId);
        }
        /// <summary>
        /// 得到小分组的头节点
        /// </summary>
        /// <param name="ccId"></param>
        /// <returns></returns>
        public DataTable GetChildProcessStiuation(string ccId)
        {
            return dal.GetChildProcessStiuation(ccId);
        }

        public DataTable GetChildProcessStiuation1(string CC_ID)
        {
            return dal.GetChildProcessStiuation1(CC_ID);
        }
        /// <summary>
        /// 相关节点（所有直系上级和下级）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <returns></returns>

        public DataTable GetRelationStiuation(string CC_ID)
        {
            return dal.GetRelationStiuation(CC_ID);
        }

        /// <summary>
        /// 相关节点（节点及所有下级）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public DataTable GetAllBelowStiuation(string CC_ID)
        {
            return dal.GetAllBelowStiuation(CC_ID);
        }

        /// <summary>
        /// 交换顺序（上移下移）
        /// </summary>
        /// <param name="Previd"></param>
        /// <param name="Nestid"></param>
        /// <returns></returns>
        public bool UpCaseCause_SeralNum(string Previd, string Nestid)
        {
            return dal.UpCaseCause_SeralNum(Previd, Nestid);
        }
        /// <summary>
        /// 保存推导规则编号
        /// </summary>
        /// <param name="CC_InferRuleTextByCode"></param>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public bool Update_CC_InferRuleText(string CC_InferRuleTextByCode, string CC_ID)
        {
            return dal.Update_CC_InferRuleText(CC_InferRuleTextByCode, CC_ID);
        }

        /// <summary>
        /// 修改诉请要素与事实要素下的XMLPATH
        /// </summary>
        /// <param name="CC_InferRuleText"></param>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public void UpdateXmlPath(string CC_ID)
        {
            dal.UpdateXmlPath(CC_ID);

            DataTable dt = GetAYCCName(CC_ID);
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    string ccid = item["CC_ID"].ToString();
                    dal.UpdateXmlPath(ccid);
                }
            }
        }

        /// <summary>
        /// 修改刑事案由等其他案由下的XMLPATH
        /// </summary>
        /// <param name="CC_InferRuleText"></param>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public void UpdateXmlPathByXS(string CC_ID)
        {
            dal.UpdateXmlPathByXS(CC_ID);
        }

        /// <summary>
        /// 删除节点
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public bool DeleteSYS_CaseCause(string CC_ID, string CC_Name, string username)
        {
            return dal.DeleteSYS_CaseCause(CC_ID, CC_Name, username);
        }

        /// <summary>
        /// 节点一级类型
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseType()
        {
            return dal.GetCaseCauseType();
        }

        /// <summary>
        /// 获取所有节点类型
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseTypeAll()
        {
            return dal.GetCaseCauseTypeAll();
        }

        /// <summary>
        /// 获取二级节点类型
        /// </summary>
        /// <param name="ccNodeType">节点类型ID</param>
        /// <returns></returns>
        public DataTable GetCaseCauseTypeByNodeType(string ccNodeType)
        {
            return dal.GetCaseCauseTypeByNodeType(ccNodeType);
        }

        /// <summary>
        /// 获取二级节点类型（固定值）
        /// </summary>
        /// <param name="ccNodeType">节点类型ID</param>
        /// <returns></returns>
        public DataTable GetCaseCauseTypeByNodeType()
        {
            return dal.GetCaseCauseTypeByNodeType();
        }

        /// <summary>
        /// 节点所有类型列表，如果ccid不为空，则获取该节点下的所有子节点的节点类型
        /// </summary>
        /// <param name="ccId">情形情节节点ID</param>
        /// <returns></returns>
        public List<SysCaseCauseType> GetCaseCauseTypeList(string ccId = null)
        {
            var dt = dal.GetCaseCauseType(ccId);
            if (dt != null && dt.Rows.Count > 0)
            {
                var list = new List<SysCaseCauseType>();
                foreach (DataRow dataRow in dt.Rows)
                {
                    var obj = new SysCaseCauseType { CcNodeType = (int)dataRow["CC_NodeType"], CcNodeTypeName = dataRow["CC_NodeTypeName"].ToString() };
                    list.Add(obj);
                }
                return list;
            }
            return null;
        }


        /// <summary>
        /// 添加来源界面批量类型下拉框选择类型（如果有一级节点类型下面的二级节点类型为空则显示一级节点类型否则只显示二级节点类型）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <returns></returns>
        public List<SysCaseCauseType> GetCaseCauseTypeByCCId(string CC_ID)
        {
            var dt = dal.GetCaseCauseTypeByCCId(CC_ID);
            if (dt != null && dt.Rows.Count > 0)
            {
                var list = new List<SysCaseCauseType>();
                foreach (DataRow dr in dt.Rows)
                {
                    var obj = new SysCaseCauseType { CcNodeType = (int)dr["CC_NodeType"], CcNodeTypeName = dr["CC_NodeTypeName"].ToString() };
                    list.Add(obj);
                }
                return list;
            }
            return null;
        }

        /// <summary>
        ///  修改（XML）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="EI_ID"></param>
        /// <returns></returns>
        public bool UpdateElementXML(string CC_ID, string ElementXML)
        {
            return dal.UpdateElementXML(CC_ID, ElementXML);
        }


        /// <summary>
        ///  修改（优选XML）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="EI_ID"></param>
        /// <returns></returns>
        public bool UpdateOptimizeXML(string CC_ID, string OptimizeXML)
        {
            return dal.UpdateOptimizeXML(CC_ID, OptimizeXML);
        }

        /// <summary>
        ///  修改（优选XML）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="EI_ID"></param>
        /// <returns></returns>
        public bool UpdateAttrRelXML(string CC_ID, string AttrRelXML)
        {
            return dal.UpdateAttrRelXML(CC_ID, AttrRelXML);
        }
        /// <summary>
        ///  修改（属性XML）
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="EI_ID"></param>
        /// <returns></returns>
        public bool UpdateConfigXML(string CC_ID, string ConfigXML)
        {
            return dal.UpdateConfigXML(CC_ID, ConfigXML);
        }

        public DataTable Select_parentNode_Name(string Cc_id)
        {
            return dal.Select_parentNode_Name(Cc_id);
        }

        // 根据节点获取他的子级节点
        public DataTable Select_parentNode_child(string Cc_id)
        {
            return dal.Select_parentNode_zi(Cc_id);
        }

        /// <summary>
        /// 判断是否是民事案由
        /// </summary>
        /// <param name="cc_Id"></param>
        /// <returns></returns>
        public bool IsCivilCase(string cc_Id)
        {
            return dal.IsCivilCase(cc_Id);
        }

        /// <summary>
        /// 根据cc_Id获取争议焦点要素下的节点集合和争议焦点要素ID
        /// </summary>
        /// <param name="cc_Id"></param>
        /// <returns></returns>
        public DataSet GetDisputeElementData(string cc_Id)
        {
            return dal.GetDisputeElementData(cc_Id);
        }

        //获取该节点下诉请\事实\基本 要素下一级类型为“xml节点”的节点集合
        public DataTable GetElementData(string cc_Id, string elementType)
        {
            return dal.GetElementData(cc_Id, elementType);
        }

        /// <summary>
        /// 修改二级节点类型事件（诉请要素18 事实要素19 基本要素20）
        /// </summary>
        /// <param name="cc_Ids">需要修改的节点集合</param>
        /// <param name="subNodeType">二级节点类型ID</param>
        /// <returns></returns>
        public bool UpdateNodeSubType(string cc_Ids, int subNodeType)
        {
            return dal.UpdateNodeSubType(cc_Ids, subNodeType);
        }

        /// <summary>
        /// 判断是否是最后一级节点
        /// </summary>
        /// <param name="cc_Id"></param>
        /// <returns></returns>
        public bool IsLastNode(string cc_Id)
        {
            return dal.IsLastNode(cc_Id);
        }

        /// <summary>
        /// 修改一级节点类型事件（倒数第一级节点变为裁判结果（字典值为22） 倒数第二级节点变为裁判理由（字典值为17）倒数第三级节点变为争议焦点（字典值为16） 倒数第四级及以上节点变为争议焦点分类（字典值为15））
        /// </summary>
        /// <param name="cc_Ids">需要修改的节点集合</param>
        /// <param name="NodeType">一级节点类型ID</param>
        /// <returns></returns>
        public bool UpdateNodeType(string cc_Ids, int NodeType)
        {
            return dal.UpdateNodeType(cc_Ids, NodeType);
        }


        /// <summary>
        /// 更改节点排序
        /// </summary>
        /// <param name="sourceItemId"></param>
        /// <param name="targetItemId"></param>
        /// <returns></returns>
        public bool UpdateItemSort(SYS_CaseCause sourceItem, SYS_CaseCause targetItem, string moveState)
        {
            return dal.UpdateItemSort(sourceItem, targetItem, moveState);
        }

        /// <summary>
        ///判断目标节点是否是原节点的子集 
        /// </summary>
        /// <param name="cc_ID"></param>
        /// <returns></returns>
        public bool IsParentRealation(string source_ID, string target_ID)
        {
            return dal.IsParentRealation(source_ID, target_ID);
        }

        /// <summary>
        ///获取一个节点的父级的第一个案由节点
        /// </summary>
        /// <param name="cc_ID"></param>
        /// <returns></returns>
        public SYS_CaseCause IsParentRealation1(string ccID)
        {
            return dal.IsParentRealation1(ccID);
        }
        /// <summary>
        /// 是否是最后一级案由
        /// </summary>
        /// <param name="cc_ID"></param>
        /// <returns></returns>
        public bool IsLastAnYou(string cc_ID)
        {
            return dal.IsLastAnYou(cc_ID);
        }


        /// <summary>
        /// 根据ccid判断该节点下是否有属性xml节点
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public String IsHaveProperty(string ccID)
        {
            return dal.IsHaveProperty(ccID);
        }

        /// <summary>
        /// 添加属性后更改排序
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public void AddPropertyUpdateSerialNum(string ccID)
        {
            dal.AddPropertyUpdateSerialNum(ccID);
        }

        /// <summary>
        /// 根据CCID获取下级节点
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public List<string> GetTongJiNodes(string ccID)
        {
            return dal.GetTongJiNodes(ccID);
        }


        /// <summary>
        /// 根据CCID获取下级包含事实要素，基本要素，诉请要素的CCID
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public string[] GetElementCcid(string ccID)
        {
            return dal.GetElementCcid(ccID);
        }

        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public DataTable GetNodeTree(string ccID, string other)
        {
            return dal.GetNodeTree(ccID, other);
        }

        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public DataTable GetNodeTree(string ccID)
        {
            return dal.GetNodeTree(ccID);
        }

        /// <summary>
        /// 根据CCID获取该节点下是否配置了来源规则
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public bool GetExpressSourceByCCId(string ccID)
        {
            return dal.GetExpressSourceByCCId(ccID);
        }

        /// <summary>
        /// 根据CCID删除该节点
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public bool DeleteCaseCauseByCCId(string ccID)
        {
            return dal.DeleteCaseCauseByCCId(ccID);
        }


        /// <summary>
        /// 得到刑事数据处理节点的下级节点
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public DataTable GetCriminalNodes(string ccID)
        {
            return dal.GetCriminalNodes(ccID);
        }

        /// <summary>
        /// 得到刑事数据处理节点的下级节点排除已经配置来源的
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public DataTable GetCriminalNodesNew(string ccID)
        {
            return dal.GetCriminalNodesNew(ccID);
        }

        /// <summary>
        /// 得到刑事数据处理节点的下级节点,民事跑数据智能数据部用
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public DataTable GetCriminalNodesByData(string ccID)
        {
            return dal.GetCriminalNodesByData(ccID);
        }

        /// <summary>
        /// 根据CCID修改该节点XmlPath
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public bool UpdateXmlPathByCCId(string xmlPath, string ccID)
        {
            return dal.UpdateXmlPathByCCId(xmlPath, ccID);
        }

        /// <summary>
        /// 根据xml中xpath获取父级和同级的xPath
        /// </summary>
        /// <param name="xPath"></param>
        /// <returns></returns>
        public DataSet GetXpath(string xPath)
        {
            return dal.GetXpath(xPath);
        }

        /// <summary>
        /// 获取导出数据类型下的数据
        /// </summary>
        /// <param name="ccId">节点ID</param>
        /// <param name="caseCauseType">类别</param>
        /// <returns></returns>
        public DataTable GetDaoChuData(string ccId, string caseCauseType)
        {
            return dal.GetDaoChuData(ccId, caseCauseType);
        }

        /// <summary>
        /// 获取导出第二数据类型下的数据
        /// </summary>
        /// <param name="ccId">节点ID</param>
        /// <param name="caseCauseType">类别</param>
        /// <returns></returns>
        public DataTable GetDaoChuSecondData(string ccId, string caseCauseType)
        {
            return dal.GetDaoChuSecondData(ccId, caseCauseType);
        }

        /// <summary>
        /// 获取正则编号
        /// </summary>
        /// <param name="ccName"></param>
        /// <param name="ccNodeTypeName"></param>
        /// <param name="xmlPath"></param>
        /// <param name="AMName"></param>
        /// <returns></returns>
        public string GetRegexInfoCode(string ccName, string ccNodeTypeName, string xmlPath, string AMName, string clickNodeTag)
        {
            return dal.GetRegexInfoCode(ccName, ccNodeTypeName, xmlPath, AMName, clickNodeTag);
        }

        /// <summary>
        /// 返回RegexInfo
        /// </summary>
        /// <param name="RegexCode"></param>
        /// <returns></returns>
        public DataTable GetRegexInfo(string RegexCode)
        {
            return dal.GetRegexInfo(RegexCode);
        }
        /// 获得争议焦点数据列表
        public DataTable GetArgumentFocus(string CC_ID)
        {
            return dal.GetArgumentFocus(CC_ID);
        }

        /// <summary>
        /// 更新争议焦点数据表审核状态
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public bool UpdateArgumentFocusState(int checkState, string saId)
        {
            return dal.UpdateArgumentFocusState(checkState, saId);
        }

        /// 获得争议焦点数据列表
        public DataTable GetArgumentFocusDispose()
        {
            return dal.GetArgumentFocusDispose();
        }

        /// 获得原有争议焦点数据列表
        public DataTable GetArgumentFocusDispose1()
        {
            return dal.GetArgumentFocusDispose1();
        }

        /// 获得原有争议焦点数据列表
        public DataTable GetArgumentFocusCaseID(string saTextID)
        {
            return dal.GetArgumentFocusCaseID(saTextID);
        }

        /// 增加争议焦点数据
        /// </summary>
        public bool AddArgumentFocus(ArgumentFocus model)
        {
            return dal.AddArgumentFocus(model);
        }

        /// 删除争议焦点数据根据文本ID
        /// </summary>
        public bool DeleteArgumentFocusByTextID(string saTextID, string saCaseID)
        {
            return dal.DeleteArgumentFocusByTextID(saTextID, saCaseID);
        }

        /// 获得原有争议焦点数据列表
        public DataTable GetArgumentFocusCase()
        {
            return dal.GetArgumentFocusCase();
        }

        /// <summary>
        /// 获取案由数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetSysCaseCauseData()
        {
            return dal.GetSysCaseCauseData();
        }

        /// <summary>
        /// 获取案由数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetSysCaseCauseAllData()
        {
            return dal.GetSysCaseCauseAllData();
        }

        /// <summary>
        /// 获取正确数据
        /// </summary>
        /// <returns></returns>
        public bool GetCurrentESID(string ccID)
        {
            return dal.GetCurrentESID(ccID);
        }

        /// <summary>
        /// 获取一个节点下面的节点类型（去重并且不包含虚节点、XML节点、XML属性）
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseNodeType(string ccId)
        {
            return dal.GetCaseCauseNodeType(ccId);
        }

        /// <summary>
        /// 根据CCID获取下级节点类型 0原告 1被告 -1原告和被告
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public int GetNextNodeType(string ccID)
        {
            return dal.GetNextNodeType(ccID);
        }

        /// <summary>
        /// 获取一个节点下面的节点类型（去重并且不包含虚节点、XML节点、XML属性）
        /// </summary>
        /// <returns></returns>
        public DataTable GetDistinctCaseCauseNodeType(string ccId)
        {
            return dal.GetDistinctCaseCauseNodeType(ccId);
        }

        /// <summary>
        /// 获取案由下的犯罪行为相关情形
        /// </summary>
        /// <param name="ccid"></param>
        /// <returns></returns>
        public string GetQXccID(string ccid)
        {
            return dal.GetQXccID(ccid);
        }

        /// <summary>
        /// 获取节点的所有父级
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public string GetAllParentIdByCCID(string ccID)
        {
            return dal.GetAllParentIdByCCID(ccID);
        }

        /// <summary>
        /// 获取案由数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetSysCaseDataByCCName(string ccName)
        {
            return dal.GetSysCaseDataByCCName(ccName);
        }


        /// <summary>
        /// 获取案由数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetAYCCName(string ccID)
        {
            return dal.GetAYCCName(ccID);
        }

        /// <summary>
        /// 修改节点第二类别（保存xml批量修改用）
        /// </summary>
        /// <param name="ccid">所修改的节点</param>
        /// <param name="nodeSubType">第二类别类型</param>
        /// <returns></returns>
        public bool UpdateCCNodeSubTypes(string ccid, string nodeSubType)
        {
            return dal.UpdateCCNodeSubTypes(ccid, nodeSubType);
        }

        /// <summary>
        /// 根据案由ccid获取子级名称是否为案由要素，如果有案由要素则xpath提取从案由要素开始
        /// </summary>
        /// <param name="ccID"></param>
        /// <returns></returns>
        public string GetAyysIDByName(string ccID)
        {
            return dal.GetAyysIDByName(ccID);
        }

        /// <summary>
        /// 获取行政执法中违法行为、违法情形的节点
        /// </summary>
        /// <returns></returns>
        public DataTable GetFCData(string ccId)
        {
            return dal.GetFCData(ccId);
        }

        /// <summary>
        /// 获取行政执法中违法行为、违法情形的节点
        /// </summary>
        /// <returns></returns>
        public DataTable GetXZZFData(string ccId)
        {
            return dal.GetXZZFData(ccId);
        }

        /// <summary>
        /// 修改分词数据
        /// </summary>
        /// <param name="ccid"></param>
        /// <param name="keyWords"></param>
        /// <returns></returns>
        public bool UpdateKeyWords(string ccid, string keyWords)
        {
            return dal.UpdateKeyWords(ccid, keyWords);
        }


        /// <summary>
        /// 获取行政执法相似违法行为数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetXZZFKeyWordByID(string ccId)
        {
            return dal.GetXZZFKeyWordByID(ccId);
        }

        /// <summary>
        /// 修改关键词数据
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool UpCaseCausePrimaryKeyWords(string CC_ID, string PrimaryKeyWords)
        {
            return dal.UpCaseCausePrimaryKeyWords(CC_ID, PrimaryKeyWords);
        }

        /// <summary>
        /// 获取需要匹配的关联违法行为数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetPPData()
        {
            return dal.GetPPData();
        }

        /// <summary>
        /// 获取关联违法行为分组数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseRelation()
        {
            return dal.GetCaseCauseRelation();
        }

        /// <summary>
        /// 删除关联违法行为数据根据关联分组
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool UpdateSYSCaseCauseRelationByGroupID(string CCR_GroupID)
        {
            return dal.UpdateSYSCaseCauseRelationByGroupID(CCR_GroupID);
        }

        /// <summary>
        /// 删除关联违法行为数据根据CCID
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool UpdateSYSCaseCauseRelationByCCID(string CC_ID, string CCR_GroupID)
        {
            return dal.UpdateSYSCaseCauseRelationByCCID(CC_ID, CCR_GroupID);
        }

        /// <summary>
        /// 插入关联违法行为数据
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool InsertSYSCaseCauseRelation(SYS_CaseCauseRelation sccr)
        {
            return dal.InsertSYSCaseCauseRelation(sccr);
        }

        /// 获取关联违法行为分组数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseRelationData(string ccID)
        {
            return dal.GetCaseCauseRelationData(ccID);
        }

        /// <summary>
        /// 插入关联违法行为数据
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool UpdateSYSCaseCauseRelation(SYS_CaseCauseRelation sccr)
        {
            return dal.UpdateSYSCaseCauseRelation(sccr);
        }

        /// <summary>
        /// 获取关联违法行为分组数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetCaseCauseRelationData()
        {
            return dal.GetCaseCauseRelationData();
        }

        /// <summary>
        /// 修改数据审核状态
        /// </summary>
        /// <param name="CC_ID"></param>
        /// <param name="PrimaryKeyWords"></param>
        /// <returns></returns>
        public bool UpdateSYSCaseCauseRelationState(string ccrId, int state)
        {
            return dal.UpdateSYSCaseCauseRelationState(ccrId, state);
        }

        /// <summary>
        /// 获取法条ID数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetQuoteLawRelData(string ccId)
        {
            return dal.GetQuoteLawRelData(ccId);
        }

        /// <summary>
        /// 修改父级及所有子级的地域
        /// </summary>
        /// <param name="ccId"></param>
        /// <param name="sysDistrict"></param>
        /// <returns></returns>
        public bool UpdateSysDistrict(string ccId, string sysDistrict)
        {
            return dal.UpdateSysDistrict(ccId, sysDistrict);
        }

        /// <summary>
        /// 获取节点的所有父级根据地域条件
        /// </summary>
        /// <param name="ccids">节点ccids</param>
        /// <returns></returns>
        public List<string> GetAllParentIdByDistrictCondition(List<string> condition)
        {
            return dal.GetAllParentIdByDistrictCondition(condition);
        }

        /// <summary>
        /// 根据查询条件获取CCID
        /// </summary>
        /// <param name="condition">条件id</param>
        /// <param name="type">1:EIid 2:RIUid 3:ERid</param>
        /// <returns>返回根据条件查询到的ccid</returns>
        public string GetCCIdBySearchCondition(string condition, int type)
        {
            return dal.GetCCIdBySearchCondition(condition, type);
        }
    }
}
